#!/usr/bin/env bash

# ----------------------------------------------------------------------
# Filename	:  05-gn-qd_001_drive.sh
# Version	:  2.0
# Date		:  2024/02/17
# Author	:  yaoxiyao
# Email		:  yaoxiyao@kylinsec.com.cn
# Function	:  GN-QD_001通用外设加载
# Out		:
#              0 => TPASS
#              1 => TFAIL
#              other=> TCONF
# ----------------------------------------------------------------------

# 测试主题
Title_Env_LTFLIB="GN-QD_001通用外设加载"

## TODO : 个性化,初始化
#   Out : 0=>TPASS
#         1=>TFAIL
#         2=>TCONF
TestInit_LTFLIB() {
    return $TPASS
}

## TODO : 清理函数
#   Out : 0=>TPASS
#         1=>TFAIL
#         2=>TCONF
TestClean_LTFLIB() {
    return $TPASS
}

## TODO : 测试用例集
#   Out : 0=>TPASS
#         1=>TFAIL
#         2=>TCONF
Testsuite_LTFLIB() {
    testcase_1
    return $TPASS
}

## TODO : 文件命名规范测试
testcase_1() {
    Info_LLE "测试显卡、网卡"
    lspci -k | grep --color -i "vga"
    CommRetParse_LTFLIB "lspci -k |grep --color -i \"vga\""
    lspci -k | grep -i "eth"
    CommRetParse_LTFLIB "lspci -k |grep -i \"eth\""
    Info_LLE "测试鼠标、键盘"
    cat /proc/bus/input/devices | grep -i "keyboard"
    CommRetParse_LTFLIB "cat /proc/bus/input/devices |grep -i \"keyboard\""
    cat /proc/bus/input/devices | grep -i "usb mouse"
    CommRetParse_LTFLIB "cat /proc/bus/input/devices |grep -i \"usb mouse\""
}

#----------------------------------------------#

source "${LIB_LTFLIB}"
Main_LTFLIB $@
